/*
 * @Author: your name
 * @Date: 2022-01-29 15:12:23
 * @LastEditTime: 2022-02-05 13:54:34
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue3-vite-tsx\src\views\Home.tsx
 */

import { defineComponent } from 'vue'

const Home = defineComponent({
  setup() {
    const handleChange = (current: number) => {
      console.log('current: ', current)
    }

    return () => (
      <div>
        <carousel showDirection={true} showDots={true} duration={3000} onChange={handleChange}>
          {new Array(5).fill(0).map((item, index) => (
            <carouselItem key={index}>
              <img src={new URL(`/images/${index}.jpg`, import.meta.url).href} alt="" />
            </carouselItem>
          ))}
        </carousel>
      </div>
    )
  }
})

export default Home
